package SuanFa;

public class testKuaiSu {
    public static void main(String[] args) {
        int[] arr = {10,7,2,4,7,62,3,4,2,1,8,9,19};
        getMun(arr, 0, arr.length-1);
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i]);
        }
    }

    public static void getMun(int[] list, int low, int high) {
        int i, j, t, temp;
        i = low;
        j = high;
        if(low>high){
            return;
        }
        temp = list[low];
        while (j > i) {
            while (list[j] >= temp && j > i) {
                j--;
            }
            while (list[i] <= temp && j > i) {
                i++;
            }
            if (j > i) {
                t = list[i];
                list[i] = list[j];
                list[j] = t;
            }
        }
        list[low]=list[i];
        list[i]=temp;
        getMun(list,low,j-1);
        getMun(list,j+1,high);
    }

}
